<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<link rel="stylesheet" type="text/css" href="../../css/appOther.css"/>
		<style>
		</style>
	</head>

	<body id='app'>
		<div class="mui-content bg_gray">
			<header class="mui-bar mui-bar-nav">
				<a class="mui-action-back mui-pull-left">
					<i class="mui-icon iconfont">&#xe62f;</i> 
					<span class="text_submain" style="vertical-align: 2px;">返回</span>
				</a>		
				<h1 class="mui-title" id="title">管理</h1>
			</header>
			<div id='wrapperTrend' class="mui-scroll-wrapper">
				<div id='scrollTrend' class="mui-scroll">
					<ul class="mui-table-view app-hide" id='container' style="margin-top: 0px;">
						<li v-for="circle in myCircles" @tap='goAdmin(circle.ID, circle.Cirname)' class="mui-table-view-cell">	
							<img :src="circle.Ciravatar" class="mui-pull-left circle-img" style="width: auto;"/>
							<p class="text_main label-title">{{circle.Cirname}}</p>						
							<p class="text_main text_hid">{{circle.Descrip}}</p>										
							<p class="text_submain mui-clearfix" style="padding-top: 5px;">						
								<span class="card_label-fl ">成员：{{circle.Membernum}}</span>
								<span class="card_label-fr">话题：{{circle.Topicnum}}</span>
							</p>																
						</li>
					</ul>
				</div>
			</div>
			<script src="../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
			<script src="../../js/mui-extend.min.js" type="text/javascript" charset="utf-8"></script>
			<script src="../../js/mui.pullToRefresh.js" type="text/javascript" charset="utf-8"></script>
			<script src="../../js/mui.pullToRefresh.material.js" type="text/javascript" charset="utf-8"></script>
			<script src="../../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
			<script src="../../js/app.js" type="text/javascript" charset="utf-8"></script>
			<script type="text/javascript" charset="utf-8">
				var vm = new Vue({
					el: '#app',
					data: {
						myCircles: [],
						scrollMyCircle: {},
						paramObj: {
							PageSize: 6,
							CurPageMyCircle: 1,
						},
					},
					ready: function() {
						var me = this;
						$('#app .app-hide').show();
						mui.init();
						ui.fixScroll(45);
						me.scrollMyCircle = ui.setPullToRefresh(this.getMyCircle);
						mui.plusReady(function () {
							showPage(plus.webview.currentWebview());
							me.getMyCircle(true);
						})
					},
					methods: {
						goAdmin: function(circleID, circleName){
							openPage('../mycenter/admin.html','admin',{
								circleID:circleID,
								circleName:circleName,
							});
						},
						getMyCircle: function(isRefresh) {
							var self = this;
							var nomore = false;
							self.paramObj.CurPageMyCircle = isRefresh ? 1 : self.paramObj.CurPageMyCircle + 1; // 当前页码

							ajax.post(api.user.getAdminCircles,{ // 请求数据
								PageSize: self.paramObj.PageSize,
								CurPage: self.paramObj.CurPageMyCircle // 当前页码
							},function (data) {
								//console.log(data.StatusCode)
								self.myCircles = isRefresh ? data.Data : self.myCircles.concat(data.Data); // 拿到数据
								nomore = data.length < self.paramObj.PageSize;
							},false,function () {
								ui.clearScrollAnimal(self.scrollMyCircle.puller, isRefresh, nomore);
							});
						}
					},
				});
			</script>
	</body>

</html>